Skip to main content
Version: Legacy SeeSo

API Docs (Unity Mobile)

Overview​

NametypeDescription
GazeTrackerclassGazeTracker is the class that generates gaze tracking data from the video from the device's front camera.
InitializationDelegateclassThis class contains a callback function that is called when the GazeTracker.initGazeTracker function is called.
StatusDelegateclassA class contains a callback function for whether gazetracker has been started or stopped.
GazeDelegateclassIncluding a callback function passing gazeInfo. class.
FaceDelegateclassIncluding a callback function passing faceInfo. class.
CalibrationDelegateclassThis class includes callback functions related to calibration.
UserStatusDelegateclassThis class contains callback functions related to UserStatus.
GazeInfoclassThis is a class that contains gaze information.
FaceInfoclassThis is a class that contains face information.
UserStatusOptionclassThe class in which the userStatusOption is defined.
CameraPosition classThis class has information about the actual camera position of the Android device.
InitializationErrorTypeenumAn enum that explains why the initialization failed.
StatusErrorTypeenumAn enum explaining why the GazeTracker stopped.
TrckingStateenumThe enum that contains state types using at GazeInfo.
EyeMovementStateenumThe Enum that contains eye movement state types using at GazeInfo
ScreenStateenumThe Enum that contains screen state types using at GazeInfo
CalibrationModeTypeenumThe enum that contains mode of GazeTracker.startCalibartion .
AccuracyCriteriaenumAn enum describing options for calibration accuracy.
UIInterfaceOrientation enumConstants that specify the orientation of the app's user interface.

GazeTracker​

public class GazeTracker

GazeTracker is the class that generates gaze tracking data from the video from the device's front camera.

Summary​

Constructor and Destructor
initGazeTracker
initGazeTracker (with User Status Options)
deinitGazeTracker
Functions
getVersionName
startTracking
stopTracking
isTracking
setTrackingFPS
setAttentionInterval
getAttentionScore
setAttentionRegion
getattentionRegion
removeattentionRegion
setForcedOrientation
resetForcedOrientation
startCalibration
stopCalibration
startCollectSamples
setCalibrationData
setCameraPreview
removeCameraPreview
setCameraPreviewAlpha
setStatusCallback
removeStatusCallback
setGazeCallback
removeGazeCallback
setFaceCallback
removeFaceCallback
setCalibrationCallback
removeCalibrationCallback
setUserStatusCallback
removeUserStatusCallback
isDeviceFound
addCameraPosition
getCameraPosition
getCameraPositionList
selectCameraPosition

initGazeTracker​

public static void initGazeTracker(string license, InitializationDelegate.onInitialized onInitialized)

GazeTracker constructing process includes authentication.

The process is asynchronous.

ParametersTypeDescription
licenseStringKey generated from SeeSo Console.
onInitializedInitializationDelegate.onInitializedThe implementation of InitializationDelegate onInitialized delegate. This contains GazeTracker construction result.

Example​

  void onInitialized(InitializationErrorType error)
{
Debug.Log("onInitialized result : " + error);
if(error == InitializationErrorType.ERROR_NONE)
{
isInitialized = true;
}
else
{
isInitialized = false;
}
}

GazeTracker.initGazeTracker("key", onInitialized);

initGazeTracker with User Status Options​

public static void initGazeTracker(string license, InitializationDelegate.onInitialized onInitialized, UserStatusOption option)

GazeTracker constructing process includes authentication.

The process is asynchronous.

The created GazeTracker instance is delivered through InitializationDelegate.

To use this initGazeTracker and User Status in your production environment, please contact to the SeeSo team.

ParametersTypeDescription
licenseStringKey generated from SeeSo Console
onInitializedInitializationDelegate.onInitializedThe implementation of InitializationDelegate onInitialized delegate. This contains GazeTracker construction result.
optionUserStatusOptionA class containing User status option information

Example​

  void onInitialized(InitializationErrorType error)
{
Debug.Log("onInitialized result : " + error);
if(error == InitializationErrorType.ERROR_NONE)
{
isInitialized = true;
}
else
{
isInitialized = false;
}
}

UserStatusOption option = new UserStatusOption();
option.useAll();

GazeTracker.initGazeTracker("key", onInitialized, option);

deinitGazeTracker​

public static void deinitGazeTracker()

After this is called, do not call gazeTracker's methods.

For memory optimization, assigning null to the destructed object is recommended.

Example​

GazeTracker.deinitGazeTracker(); 

getVersionName​

public static string getVersionName()

Returns SeeSo SDK version.

Return TypeDescription
stringversion name

Example​

string version = GazeTracker.getVersionName();
Debug.Log("SeeSo version: " + version);

startTracking​

public static void startTracking()

This is the function that should be called before starting gaze tracking.

It calls the onStarted() function when gaze tracking initialization succeeded and setstatusCallback has been attached to GazeTracker.

Example​


void onStarted()
{
Debug.Log("onStarted");
isTracking = true;
}

void onStopped(StatusErrorType error)
{
Debug.Log("onStopped with error : " + error);
isTracking = false;
}

GazeTracker.setStatusCallback(onStarted, onStopped);

// after initGazeTracker Success, Call startTracking
GazeTracker.startTracking();

stopTracking​

public static void stopTracking()

This function is called to stop gaze tracking.

It calls the onStop() function when setStatusCallback(onStarted, onStopped) has been attached to GazeTracker.

Example​


void onStarted()
{
Debug.Log("onStarted");
isTracking = true;
}

void onStopped(StatusErrorType error)
{
Debug.Log("onStopped with error : " + error);
isTracking = false;
}

GazeTracker.stopTracking();

isTracking​

public static bool isTracking()

This function represents the status of gaze tracking.

Return TypeDescription
boolIt returns true when gaze tracking is working, false when gaze tracking is stopped.

Example​

bool isTracking = GazeTracker.isTracking();

setTrackingFPS​

public static bool setTrackingFPS(int fps)

The parameter that sets the FPS of the gaze tracking source.

Its value should bigger than 0 and no more than 30.

FPS can be dropped due to device spec. The default value is 30.

ParametersTypeDescription
fpsintCustom FPS(Frame Per Second) for gaze tracking
Return TypeDescription
boolsuccess

Example​

GazeTracker.setTrackingFPS(20);

setAttentionInterval​

public static void setAttentionInterval(int interval)

Set time interval for the UserStatus Attention callback.

The UserStatus Attention score will be calculated for the given time interval.

The beginning and ending timestamps are passed through the onAttention callback as timestampBegin and timestampEnd.

The interval range is 10 to 60 (seconds), and the default value is 30 seconds.

ParametersTypeDescription
intervalintTime interval for the UserStatus Attention score.

Example​

GazeTracker.setAttentionInterval(30);

getAttentionScore​

public static float getAttentionScore()

Get current Attention score from the GazeTracker.

This API does not provide timestamp of the Attention score data.

Use onAttention callback, unless the Attention score is required at a specific time/location.

Return TypeDescription
floatAttention score.

Example​

float score = GazeTracker.getAttentionScore();

setAttentionRegion​

public static void setAttentionRegion(float left, float top, float right, float bottom)

Set Attention ROI

ParametersTypeDescription
leftfloatLeft boundary of attention region.
topfloatTop boundary of attention region.
rightfloatRight boundary of attention region.
bottomfloatBottom boundary of attention region.
note

Device screen region is set as default.

Example​

// Set attention region that (x,y) = (100,100), (width, height) = 100,100  
GazaTracker.setAttentionRegion(100,100,200,200)

getAttentionRegion​

public static float[] getAttentionRegion()
Return TypeDescription
float[]If the region is not set, returns an empty array. Otherwise, returns left, top, right, bottom passed from setAttentionRegion

removeAttentionRegion​

public static void removeAttentionRegion()

Remove Attention ROI

setForcedOrientation ​

 public static void setForcedOrientation(UIInterfaceOrientation orientation)

Set the forced device orientation for the GazeTracker. This function sets the orientation of the device forcibly for certain situations. Specifically, when the device is in portrait lock mode and the developer wants to rotate it to landscape mode, the gaze coordinates also need to be rotated. However, the function only works when not in the calibration process, meaning that the device's orientation cannot be forcibly changed during calibration.

ParametersTypeDescription
orientationUIInterfaceOrientationThe forced device orientation.

Example​

  GazeTracker.setForcedOrientation(UIInterfaceOrientation.LANDSCAPE_LEFT);

resetForcedOrientation ​

 public static void resetForcedOrientation()

Reset the forced device orientation for the GazeTracker. This function resets the orientation of the device that was forcibly set by the setForcedOrientation function. After this function is called, the device orientation will no longer be forcibly controlled, and the gaze coordinates will be determined based on the actual device orientation.

However, this function only works when not in the calibration process, meaning that the device's orientation cannot be forcibly changed during calibration.

Example​

  GazeTracker.resetForcedOrientation();

startCalibration​

public static bool startCalibration(CalibrationModeType calibrationModeType, float left, float top, float right, float bottom)
public static bool startCalibration(CalibrationModeType mode, AccuracyCriteria criteria)
public static bool startCalibration(float left, float top, float right, float bottom)
public static bool startCalibration()
ParametersTypeDescription
calibrationModeTypeCalibrationModeTypeCan select the calibration option. DEFAULT(=FIVE_POINT), ONE_POINT, FIVE_POINT, SIX_POINT.
leftfloatRegion that needs calibration. The unit is px.
topfloatRegion that needs calibration. The unit is px.
rightfloatRegion that needs calibration. The unit is px.
bottomfloatRegion that needs calibration. The unit is px.
criteriaAccuracyCriteriaOption that manage calibration process and accuracy. Three options - DEFAULT, LOW, HIGH - are available. Default is DEFAULT.
Return TypeDescription
boolIt returns true when parameters are valid. The false return will block the calibration process.

Example​

void onCalibrationNextPoint(float x, float y)
{
Debug.Log("onCalibrationNextPoint" + x + "," + y);

calibrationX = _convertCoordinateX(x);
calibrationY = _convertCoordinateY(y);

isNextStepReady = true;

}
void onCalibrationProgress(float progress)
{
Debug.Log("onCalibrationProgress" + progress);
calibrationProgress = progress;
}

void onCalibrationFinished(double[] calibrationData)
{
Debug.Log("OnCalibrationFinished" + calibrationData.Length);
isCalibrationFinished = true;
}

GazeTracker.setCalibrationCallback(onCalibrationNextPoint, onCalibrationProgress, onCalibrationFinished);

bool success = GazeTracker.startCalibration();

stopCalibration​

public static void stopCalibration()

Example​

GazeTracker.stopCalibration();

startCollectSamples​

public static bool startCollectSamples()

This relies on the coordinates of the target point which should be displayed when calibration is in progress at the function: CalibrationDelegate.onCalibrationNextPoint.

You should display the coordinates on the screen and call startCollectSamples for calibration.

Return TypeDescription
booleanIt returns true when parameters are valid

Example​

if (isNextStepReady)
{
isNextStepReady = false;
GazeTracker.startCollectSamples();
}

setCalibrationData​

public static bool setCalibrationData(double[] calibrationData)

Set existing calibration data to gazeTracker.

ParametersTypeDescription
calibrationDatadouble[]Calibration Data
Return TypeDescription
booleanIt returns true when parameters are valid

Example​


void onCalibrationFinished (double[] calibrationData)
{
Debug.Log("calibration is done");

appStorageCalibrationData = calibrationData;
}

// when you restart app etc...
// you can set existing calibration data without new calibration
GazeTracker.setCalibrationData(appStorageCalibrationData);


setCameraPreview​

public static void setCameraPreview(float left, float top, float right, float bottom)

Set camera preview to appear in the specified location

For Android, previews used by GazeTracker must be hardware acceleration enabled

ParametersTypeDescription
leftfloatRegion that needs camera preview. The unit is px.
topfloatRegion that needs camera preview. The unit is px.
rightfloatRegion that needs camera preview. The unit is px.
bottomfloatRegion that needs camera preview. The unit is px.

Example​

  GazeTracker.setCameraPreview(previewLeft, previewTop, previewRight, previewBottom);

removeCameraPreview​

public static void removeCameraPreview()

Remove camera preview

Example​

GazeTracker.removeCameraPreview();

setCameraPreviewAlpha​

public static void setCameraPreviewAlpha(float alpha)

Adjust the alpha value of the camera preview.

ParametersTypeDescription
alphafloatCamera preview alpha (0.0f ~ 1.0f)

Example​

GazeTracker.setCameraPreviewAlpha(0.5f);

setStatusCallback​

public static void setStatusCallback(StatusDelegate.onStarted onStarted, StatusDelegate.onStopped onStopped)

Enroll StatusDelegate delegate implementation to GazeTracker.

ParametersTypeDescription
onStartedStatusDelegate.onStartedStatusDelegate onStarted delegate implementation. This will be called when tracking started
onStoppedStatusDelegate.onStoppedStatusDelegate onStopped delegate implementation. This will be called with error information when tracking stopped

Example

GazeTracker.setStatusCallback(onStarted, onStoped);

void onStarted()
{
Debug.Log("tracking is started");
}

void onStopped(int error)
{
Debug.Log("tracking is stopped");
if(error == 0) Debug.Log(InitializationErrorType.ERROR_NONE);
if(error == 1) Debug.Log(InitializationErrorType.ERROR_CAMERA_START);
if(error == 2) Debug.Log(InitializationErrorType.ERROR_CAMERA_INTERRUPT);
}

GazeTracker.startTracking();

removeStatusCallback​

public static void removeStatusCallback()

Remove all StatusDelegate implementations registered at GazeTracker

Example​

GazeTracker.removeStatusCallback();

setGazeCallback​

public static void setGazeCallback(GazeDelegate.onGaze onGaze)

Enroll GazeDelegate delegate implementation to GazeTracker.

ParametersTypeDescription
onGazeGazeDelegate.onGazeGazeDelegate onGaze delegate implementation.

Example​

void onGaze(GazeInfo gazeInfo)
{
Debug.Log("onGaze " + gazeInfo.x + "," + gazeInfo.y);
}

GazeTracker.setGazeCallback(onGaze);
GazeTracker.startTracking();

removeGazeCallback​

public void removeGazeCallback()

Remove all GazeDelegate delegate implementations registered at GazeTracker

Example​

GazeTracker.removeGazeCallback();

setFaceCallback​

public static void setFaceCallback(FaceDelegate.onFace onFace)

Enroll FaceDelegate delegate implementation to GazeTracker.

ParametersTypeDescription
onFaceFaceDelegate.onFaceFaceDelegate onFace delegate implementation.

Example​

void onFace(FaceInfo faceInfo)
{
Debug.Log("onFace " + faceInfo.timestamp + "," + faceInfo.score);
}

GazeTracker.setFaceCallback(onFace);

removeFaceCallback​

public void removeFaceCallback()

Remove all FaceDelegate delegate implementations registered at GazeTracker

Example​

GazeTracker.removeFaceCallback();

setCalibrationCallback​

public void setCalibrationCallback(
CalibrationDelegate.onCalibrationNextPoint onCalibrationNextPoint
CalibrationDelegate.onCalibrationProgress onCalibrationProgress
CalibrationDelegate.onCalibrationFinished onCalibrationFinished
)

Enroll CalibrationDelegate delegate implementation to GazeTracker.

ParametersTypeDescription
onCalibrationNextPointCalibrationDelegate.onCalibrationNextPointCalibrationDelegate onCalibrationNextPoint delegate implementation.
onCalibrationProgressCalibrationDelegate.onCalibrationProgressCalibrationDelegate onCalibrationProgress delegate implementation.
onCalibrationFinishedCalibrationDelegate.onCalibrationFinishedCalibrationDelegate onCalibrationFinished delegate implementation.

Example​

void onCalibrationNextPoint (float x, float y)
{
Debug.Log("current step calibration point will be positioned to " + x + "," + y);

// draw calibration point to x,y in Main Thread
// then call startCollectSamples
// GazeTracker.startCollectSamples();
}

void onCalibrationProgress (float progress)
{
Debug.Log("current point's calibration progress: ");
}

void onCalibrationFinished (double[] calibrationData)
{
Debug.Log("calibration is done");
}

GazeTracker.setCalibrationCallback(onCalibrationNextPoint, onCalibrationProgress, onCalibrationFinished);
GazeTracker.startCalibration();

removeCalibrationCallback​

public void removeCalibrationCallback()

Remove all CalibrationDelegate delegate implementations registered at GazeTracker

Example​

GazeTracker.removeCalibrationCallback();

setUserStatusCallback​

public static void setUserStatusCallback(UserStatusDelegate.onAttention onAttention, UserStatusDelegate.onBlink onBlink, UserStatusDelegate.onDrowsiness onDrowsiness)

Enroll UserStatusDelegate delegate implementation to GazeTracker.

ParametersTypeDescription
onAttentionUserStatusDelegate.onAttentionUserStatusDelegate onAttention delegate implementation.
onBlinkUserStatusDelegate.onBlinkUserStatusDelegate onBlink delegate implementation.
onDrowsinessUserStatusDelegate.onDrowsinessUserStatusDelegate onDrowsiness delegate implementation.

Example​

void onAttention(long timestampBegin, long timestamEnd, float score)
{
Debug.Log("onAttention " + score);
}

void onBlink(long timestamp, bool isBlinkLeft, bool isBlinkRight, bool isBlink, float leftOpenness, float rightOpenness)
{
Debug.Log("onBlink " + isBlinkLeft + ", " + isBlinkRight + ", " + isBlink);
}

void onDrowsiness(long timestamp, bool isDrowsiness, double intensity)
{
Debug.Log("onDrowsiness " + isDrowsiness);
}

GazeTracker.setUserStatusCallback(onAttention, onBlink, onDrowsiness);
GazeTracker.startTracking();

removeUserStatusCallback​

public void removeUserStatusCallback()

Remove all UserStatusDelegate delegate implementations registered at GazeTracker

Example​

GazeTracker.removeUserStatusCallback();

isDeviceFound ​

public static bool isDeviceFound()
Return TypeDescription
booleanif it was true, device was founded. iOS always false

Example​

boolean isFound = GazeTracker.isDeviceFound();

addCameraPosition ​

public static void addCameraPosition(CameraPosition cameraPosition)

Add CameraPosition to GazeTracker instance.

ParametersTypeDescription
cameraPositionCameraPositionCameraPosition class

Example​

CameraPosition cameraPosition = new CameraPosition("SM-T720", -72f, -4f, false);// tab s5e
GazeTracker.addCameraPosition(cameraPosition);

getCameraPosition ​

public CameraPosition getCameraPosition()
Return TypeDescription
CameraPositionCameraPosition class

Example​

CameraPosition cameraPosition = GazeTracker.getCameraPosition();
Debug.Log(cameraPosition.modelName + " : " + cameraPosition.screenOriginX + " : " + cameraPosition.screenOriginY);

getCameraPositionList ​

public static CameraPosition[] getCameraPositionList()
Return TypeDescription
CameraPosition []Array of CameraPosition of the device. A device can have multiple CameraPosition (ex. Galaxy Fold)

Example​

CameraPosition[] cameraPositionList = GazeTracker.getCameraPositionList();
for (CameraPosition cameraPosition : cameraPositionList) {
Debug.Log(cameraPosition.modelName + " : " + cameraPosition.screenOriginX + " : " + cameraPosition.screenOriginY);
}

selectCameraPosition ​

public static void selectCameraPosition(int idx)
ParametersTypeDescription
idxIntIndex of the CameraPosition to use from getCameraPositionList().

Example​

GazeTracker.selectCameraPosition(0);

InitializationDelegate​

public class InitializationDelegate

Summary​

function
onInitialized

onInitialized​

public delegate void onInitialized(InitializationErrorType error);

This is delegate function being called when GazeTracker.initGazeTracker function has been called.

See Authentication for more details.

ParametersTypeDescription
errorInitializationErrorTypeError code

Example​

  GazeTracker.initGazeTracker("key", onInitialized);

void onInitialized(InitializationErrorType error)
{
...
}

StatusDelegate​

public class StatusDelegate

onStarted​

public delegate void onStarted()

The function calld automatically after startTracking of GazeTracker object succeeds. Calibration is available after this call.

Example​

  void onStarted()
{
Debug.Log("onStarted");
isTracking = true;
}

void onStopped(StatusErrorType error)
{
Debug.Log("onStopped with error : " + error);
isTracking = false;
}

GazeTracker.setStatusCallback(onStarted, onStopped);

GazeTracker.startTracking();

onStopped​

public delegate void onStopped(StatusErrorType error)
ParametersTypeDescription
errorStatusErrorTypeERROR_NONE, ERROR_CAMERA_START, ERROR_CAMERA_INTERRUPT.

Example​

  void onStarted()
{
Debug.Log("onStarted");
isTracking = true;
}

void onStopped(StatusErrorType error)
{
Debug.Log("onStopped with error : " + error);
isTracking = false;
}

GazeTracker.setStatusCallback(onStarted, onStopped);

GazeTracker.startTracking();

GazeDelegate​

public class GazeDelegate

onGaze​

public delegate void onGaze(GazeInfo gazeInfo)
ParametersTypeDescription
gazeInfoGazeInfoGazeInfo

example​


void onGaze(GazeInfo gazeInfo)
{
Debug.Log("onGaze " + gazeInfo.timestamp + "," + gazeInfo.x + "," + gazeInfo.y + "," + gazeInfo.trackingState + "," + gazeInfo.eyeMovementState + "," + gazeInfo.screenState);
}

GazeTracker.setGazeCallback(onGaze);
GazeTracker.startTracking();

CalibrationDelegate​

public class CalibrationDelegate

onCalibrationNextPoint​

public delegate void onCalibrationNextPoint(float x, float y)

The x, y coordinate value of the gaze point that should be focused on during the calibration process. A proper UI should be displayed on the screen to notify the calibration target point. You should call startCollectSamples to process the calibration.

ParametersTypeDescription
xfloatThe x coordinate value of the gaze point that should be focused on during the calibration process. Origin is the device screen. The unit is pixel(px).
yfloatThe y coordinate value of the gaze point that should be focused on during the calibration process. Origin is the device screen. The unit is pixel(px).

Example​

void onCalibrationNextPoint (float x, float y)
{
Debug.Log("current step calibration point will be positioned to " + x + "," + y);

// draw calibration point to x,y in Main Thread
// then call startCollectSamples
// GazeTracker.startCollectSamples();
}

void onCalibrationProgress (float progress)
{
// Debug.Log("current point's calibration progress: " + progress);
}

void onCalibrationFinished (double[] calibrationData)
{
// Debug.Log("calibration is done");
}

GazeTracker.setCalibrationCallback(onCalibrationNextPoint, onCalibrationProgress, onCalibrationFinished);
GazeTracker.startCalibration();

onCalibrationProgress​

public delegate void onCalibrationProgress(float progress)

This is callback function that represents the calibration progression. The value will be between 0.0~1.0. The value start increases when startCollectSamples function executed.

For UX, visualize the calibration progression with proper UI is recommended.

ParametersTypeDescription
progressfloatCalibration progression for each point.

Example​

void onCalibrationNextPoint (float x, float y)
{
//Debug.Log("current step calibration point will be positioned to " + x + "," + y);

// draw calibration point to x,y in Main Thread

// then call startCollectSamples
// GazeTracker.startCollectSamples();
}

void onCalibrationProgress (float progress)
{
Debug.Log("current point's calibration progress: " + progress);
}

void onCalibrationFinished (double[] calibrationData)
{
//Debug.Log("calibration is done");
}

GazeTracker.setCalibrationCallback(onCalibrationNextPoint, onCalibrationProgress, onCalibrationFinished);
GazeTracker.startCalibration();

onCalibrationFinished​

    public delegate void onCalibrationFinished(double[] calibrationData)

This is callback function that notify if all calibration steps are finished.

The calibrationData is passed as a parameter, it has already been applied to GazeTracker.

You can save or load this calibration data directly into GazeTracker without new calibration process by calling setCalibrationData(calibrationData) when restarting the app etc..

ParametersTypeDescription
calibrationDatadouble[]Calibration Data

Example​

void onCalibrationNextPoint (float x, float y)
{
//Debug.Log("current step calibration point will be positioned to " + x + "," + y);

// draw calibration point to x,y in Main Thread
// then call startCollectSamples
// GazeTracker.startCollectSamples();
}

void onCalibrationProgress (float progress)
{
// Debug.Log("current point's calibration progress: " + progress);
}

void onCalibrationFinished (double[] calibrationData)
{
Debug.Log("calibration is done");
// Delete Calibration Point
// The gaze data became robust!
}

GazeTracker.setCalibrationCallback(onCalibrationNextPoint, onCalibrationProgress, onCalibrationFinished);
GazeTracker.startCalibration();

UserStatusDelegate​

public class UserStatusDelegate

The User Status includes Attention, Drowsiness, and Blink.

  1. Attention: How much the user attention is focused on the screen content for interval time (0.0 ~ 1.0)

  2. Drowsiness: If the user feel drowsiness (True/False)

  3. Blink: If the user blink eyes (left eye, right eye, general(both eyes))

onAttention​

public void onAttention(long timestampBegin, long timestampEnd, float score)
ParametersTypeDescription
timestampBeginlongBeginning Timestamp of the data.
timestampEndlongEnding Timestamp of the data.
scorefloatUser Attention rate score between the timestamps.

Example​

void onAttention(long timestampBegin, long timestamEnd, float score)
{
userStatusAttention = "" + score;
Debug.Log("onAttention " + score);
}

GazeTracker.setUserStatusCallback(onAttention, onBlink, onDrowsiness);

onDrowsiness​

public delegate void onDrowsiness(long timestamp, bool isDrowsiness, double intensity)
ParametersTypeDescription
timestamplongTimestamp of the data.
isDrowsinessboolUser Drowsiness flag.
intensitydoubleLevel of drowsiness intensity (0 to 1)

Example​

void onDrowsiness(long timestamp, bool isDrowsiness)
{
userStatusDrowsiness = "" + isDrowsiness;
Debug.Log("onDrowsiness " + isDrowsiness);
}

GazeTracker.setUserStatusCallback(onAttention, onBlink, onDrowsiness);
public delegate void onBlink(long timestamp, bool isBlinkLeft, bool isBlinkRight, bool isBlink, float leftOpenness, float rightOpenness)
ParametersTypeDescription
timestamplongTimestamp of the data.
isBlinkLeftboolUser Left Blink flag.
isBlinkRightboolUser Right Blink flag.
isBlinkboolUser Blink flag.
leftOpennessfloatUser left eye-openness rate.
rightOpennessfloatUser right eye-openness rate.

Example​

void onBlink(long timestamp, bool isBlinkLeft, bool isBlinkRight, bool isBlink, float leftOpenness, float rightOpenness)
{
userStatusBlink = "blink : " + isBlink;
Debug.Log("onBlink " + isBlinkLeft + ", " + isBlinkRight + ", " + isBlink);
}

GazeTracker.setUserStatusCallback(onAttention, onBlink, onDrowsiness);

GazeInfo​

public class GazeInfo
{
public long timestamp;
public float x;
public float y;
public float fixationX;
public float fixationY;
public float leftOpenness;
public float rightOpenness;
public TrackingState trackingState;
public EyeMovementState eyeMovementState;
public ScreenState screenState;
}

Summary​

Variablestypedescription
timestamplongTimestamp of gaze point. The unit is millisecond. The time format is UTC.
xfloatx, y coordinate value of gaze point. Origin is device screen. The unit is pixel
yfloatx, y coordinate value of gaze point. Origin is device screen. The unit is pixel
fixationXfloatx coordinate value of last fixation point. Origin is device screen. The unit is in point(px).
fixationYfloaty coordinate value of last fixation point. Origin is device screen. The unit is in point(px).
leftOpennessfloatopenness degree of left eye(0.0~1.0). value will only return when userStatusOption in on
rightOpennessfloatopenness degree of right eye(0.0~1.0). value will only return when userStatusOption in on
trackingStateTrackingStateSUCCESS, LOW_CONFIDENCE, UNSUPPORTED, FACE_MISSING
eyeMovementStateEyeMovementStateFIXATION, SACCADE, UNKNOWN
screenStateScreenStateINSIDE_OF_SCREEN, OUTSIDE_OF_SCREEN, UNKNOWN

FaceInfo​

public class FaceInfo
{
public long timestamp;
public float score;
public float frameWidth;
public float frameHeight;
public Rect rect;
public float pitch;
public float yaw;
public Vector3 centerXYZ;

}

Summary​

Variablestypedescription
timestamplongTimestamp of gaze point. The unit is millisecond. The time format is UTC.
scorefloatValue of facial recognition confidence (0.0 ~ 1.0).
frameWidthfloatcamera frame width size.
frameHeightfloatcamera frame height size.
rectRectIndicates the position of the face in the camera frame.
pitchfloatDegree of vertical tilt of the face.
yawfloatDegree of horizontal tilt of the face.
centerXYZVector3The x,y,z distance of the center of the face from the camera. The unit is mm.

UserStatusOption​

public class UserStatusOption

The class contains User Status options information for GazeTracker

Summary​

functions
isUseAttention
isUseBlink
isUseDrowsiness
useAttention
useBlink
useDrowsiness
useAll

isUseAttention​

Return TypeDescription
boolReturn true if Attention flag is on, otherwise return false.
Return TypeDescription
boolReturn true if Blink flag is on, otherwise return false.

isUseDrowsiness​

Return TypeDescription
boolReturn true if Drowsiness flag is on, otherwise return false.

useAttention​

Set Attention flag.

Set Blink flag.

useDrowsiness​

Set Drowsiness flag.

useAll​

Set All User Status flag.


CameraPosition ​

public class CameraPosition
{
public string modelName;
public float screenOriginX;
public float screenOriginY;
public bool cameraOnLongerAxis;
}

This class indicates the relative position from the camera to the screen origin. GazeTracker uses the information to calculate gaze coordinate.

For more information, see gaze coordinate

Summary​

Variablestypedescription
modelNameStringDevice model name
screenOriginXfloatX's Distance from the camera to the top left corner of the screen (mm)
screenOriginYfloatY's Distance from the camera to the top left corner of the screen (mm)
cameraOnLongerAxisboolA bool value representing when the camera is placed on the device's long axis.

InitializationErrorType​

public enum InitializationErrorType

The enum that contains error types of InitializationDelegate.

Please read : Authentication for more details.


StatusErrorType​

public enum StatusErrorType

The enum that contains error types of StatusDelegate

NameDescription
ERROR_NONESucceed without error
ERROR_CAMERA_STARTGazeTracker.startTracking is called but the front camera of the device is not available
ERROR_CAMERA_INTERRUPTThe camera stream is disturbed(i.e. used by other applications) or the application running at the background

TrackingState​

public enum TrackingState

The enum that contains state types using at GazeInfo.

NameDescription
SUCCESSFace alignment is in a best position (Gaze tracking success, with valid x and y)
LOW_CONFIDENCEFace alignment is not in the best position, but can be used for tracking (Gaze tracking success, with less accurate x and y)
UNSUPPORTEDFace alignment is not suitable for tracking (Gaze tracking fail, with invalid x and y)
FACE_MISSINGFace is missing (Gaze tracking fail)

EyeMovementState​

public enum EyeMovementState

The Enum that contains eye movement state types using at GazeInfo

NameDescription
FIXATIONGazes from the past and the gazes up to the present have made a fixation
SACCADEGazes from the past and the gazes up to the present have formed a saccade
UNKNOWNNot fixation or saccade

ScreenState​

public enum ScreenState

The Enum that contains screen state types using at GazeInfo

NameDescription
INSIDE_OF_SCREENGaze tracking succeeds and the gaze point is inside of the device screen
OUTSIDE_OF_SCREENGaze tracking succeeds and the gaze point is outside of the device screen
UNKNOWNGaze tracking failed

CalibrationModeType​

public enum CalibrationModeType

The enum that contains mode of startCalibartion .

NameDescription
DEFAULTSet to the recommended mode. In the current version, Five-point calibration mode
ONE_POINTOne-point calibration mode
FIVE_POINTFive-point calibration mode
SIX_POINTSix-point calibration mode

AccuracyCriteria​

public enum AccuracyCriteria

The enum that contains accuracy criteria of startCalibartion .

NameDescription
DEFAULTDefault calibration accuracy criteria
LOWLow calibration accuracy criteria
HIGHHigh calibration accuracy criteria

UIInterfaceOrientation ​

public enum UIInterfaceOrientation

Constants that specify the orientation of the app's user interface.

NameDescription
UNKNOWNThe orientation of the device is unknown. (Not available for use.)
PORTRAITThe device is in portrait mode, with the device upright and the Home button on the bottom.
PORTRAIT_UPSIDE_DOWNThe device is in portrait mode but is upside down, with the device upright and the Home button at the top.
LANDSCAPE_RIGHTThe device is in landscape mode, with the device upright and the Home button on the right.
LANDSCAPE_LEFTThe device is in landscape mode, with the device upright and the Home button on the left.